﻿Public Class CustLib
    Private m_loginID As String
    Private m_First_Name As String
    Private m_Last_Name As String
    Private m_Address As String
    Private m_City As String
    Private m_State As String
    Private m_ZipCode As String
    Private m_Email As String
    Private m_Password As String
    Private m_TotalDollarSales As Double
    Private m_Cart As String

    Public Property LoginID As String
        Get
            Return m_loginID

        End Get
        Set(value As String)
            m_loginID = value
        End Set
    End Property

    Public Property FirstName As String
        Get
            Return m_First_Name

        End Get
        Set(value As String)
            m_First_Name = value
        End Set
    End Property

    Public Property LastName As String
        Get
            Return m_Last_Name

        End Get
        Set(value As String)
            m_Last_Name = value
        End Set
    End Property

    Public Property City As String
        Get
            Return m_City

        End Get
        Set(value As String)
            m_City = value
        End Set
    End Property

    Public Property State As String
        Get
            Return m_State

        End Get
        Set(value As String)
            m_State = value
        End Set
    End Property

    Public Property Address As String
        Get
            Return m_Address

        End Get
        Set(value As String)
            m_Address = value
        End Set
    End Property

    Public Property ZipCode As String
        Get
            Return m_ZipCode

        End Get
        Set(value As String)
            m_ZipCode = value
        End Set
    End Property

    Public Property Email As String
        Get
            Return m_Email

        End Get
        Set(value As String)
            m_Email = value
        End Set
    End Property

    Public Property Password As String
        Get
            Return m_Password

        End Get
        Set(value As String)
            m_Password = value
        End Set
    End Property

    Public Property TotalDollarSales As Double
        Get
            Return m_TotalDollarSales

        End Get
        Set(value As Double)
            m_TotalDollarSales = value
        End Set
    End Property

    Public Property Cart As String
        Get
            Return m_Cart

        End Get
        Set(value As String)
            m_Cart = value
        End Set
    End Property

    Public Shared Function CheckUser(thisUser As String)
        Dim checkUserConnect As New DBConnect
        Dim checkUserResult As String
        Dim checkUserSQL As String = "SELECT LoginID FROM Customer_t WHERE LoginID = @Username;"
        Dim checkUserCommand As New System.Data.SqlClient.SqlCommand(checkUserSQL)
        checkUserCommand.Parameters.Add("@Username", SqlDbType.Text)
        checkUserCommand.Parameters("@Username").Value = thisUser
        checkUserResult = checkUserConnect.ExecScalarFunction(checkUserCommand)
        checkUserConnect.closeConSql()

        Return checkUserResult
    End Function

    'Function GetPassword()

    'End Function

End Class
